library(plotly)
## Loading required package: ggplot2
## Registered S3 methods overwritten by 'ggplot2':
## method from
## [.quosures rlang
## c.quosures rlang
## print.quosures rlang
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
set.seed(100)
d <- diamonds[sample(nrow(diamonds), 1000), ]
p <- ggplot(data = d, aes(x = carat, y = price)) +
geom_point(aes(text = paste("Clarity:", clarity)), size = 4) +
geom_smooth(aes(colour = cut, fill = cut)) + facet_wrap(~ cut)
## Warning: Ignoring unknown aesthetics: text
p <- ggplotly(p)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
p
{r} # # Sys.setenv("plotly_username"=keys$Plotly$user) # Sys.setenv("plotly_api_key"=keys$Plotly$key) #
{r} # api_create(p, filename = "getting-started/ggplotly") #